# Maintainer: Thiago Perrotta <tbperrotta@gmail.com>
pkgname=bkt
pkgver=0.8.0
pkgrel=0
pkgdesc="A subprocess caching utility"
url="https://www.bkt.rs/"
# loongarch64: blocked by libc crate
arch="all !loongarch64"
license="MIT"
makedepends="cargo cargo-auditable"
checkdepends="bash"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/dimo414/bkt/archive/refs/tags/$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname"
}

sha512sums="
3a2d606503ca6305b0b038cf3249aa6cf9b129435c31dcc7624e846c55890bf81ddd98ec8757c406156aa009f4654529695935edde54e0cd2f659c8db99f7444  bkt-0.8.0.tar.gz
"
